////https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da?tpId=37&&tqId=21224&rp=5&ru=/activity/oj&qru=/ta/huawei/question-ranking
//
//#include <iostream>
//#include <string>
//using namespace std;
//
//int main()
//{
//    string str;
//    str.reserve(5000);
//    getline(cin, str);
//    size_t last_space = str.rfind(' ');
//    if (last_space != string::npos)
//        cout << str.size() - last_space - 1 << endl;
//    else
//        cout << str.size() << endl;
//
//    return 0;
//}